package receiver;

import static org.junit.Assert.*;

import org.junit.Test;

public class TestPressePapier {

	@Test
	public void testSetContenu() {
		PressePapier pp = new PressePapier();
		assertTrue(pp.getContenu() == null);
		
		pp.setContenu("contenue");
		assertEquals(pp.getContenu(), "contenue");
		pp.setContenu("");
		assertFalse(pp.getContenu().length()>0);
	}

	@Test
	public void testGetContenu() {
		PressePapier pp = new PressePapier();
		assertTrue(pp.getContenu() == null);
		
		pp.setContenu("contenue");
		assertEquals(pp.getContenu(), "contenue");
	}
	
	@Test
	public void testClone() throws CloneNotSupportedException{
		PressePapier pp = new PressePapier();
		assertTrue(pp.getContenu() == null);
		
		pp.setContenu("contenue");
		assertEquals(pp.getContenu(), "contenue");
		
		PressePapier ppClone = (PressePapier) pp.clone();
		ppClone.setContenu("nouveau contenue");
		
		assertFalse(pp.getContenu() == ppClone.getContenu());
	}
	

}
